<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function getSum(l,r){
            let sum = 0;
            for(let i =l;i <= r;++i) sum += i;
            document.write(l+'加到'+ r +'的和为:'+sum+"<br>");
        }
        getSum(5,10);
        getSum(100,1000);
    </script>
</body>
</html>